home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 35 / The Games Machine - Ita - CD-ROM Vol.35 / dkedemo it.iso / Trucks / INSTALL / PROBLEM / FASTVID.TXT < prev    next >
Encoding:
Text File  |  1996-10-24  |  18.4 KB  |  366 lines

  1.  
  2. FastVid 1.03.  Copyright 1996 by John Hinkley.  72466.1403@compuserve.com
  3.  
  4. --------------------------------------------------------------------------
  5. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  6. --------------------------------------------------------------------------
  7.  
  8. THIS PROGRAM WILL ONLY WORK ON PENTIUM PRO PROCESSORS.  IT WILL NOT WORK,
  9. AND IS NOT NEEDED, ON PENTIUM AND EARLIER CPU's.
  10.  
  11. According to Intel, enabling Write Posting (see below) on 82450 steppings
  12. before B0 could result in "rare" problems on the PCI bus.  If the program
  13. indicates that Write Posting is enabled when you first run this program
  14. (the "Before" message) then you have a B0 or later stepping of the 82450
  15. and don't need to worry about the A2 bugs.  The problem will manifest
  16. itself when there are high levels of traffic on the PCI bus -- multiple
  17. devices reading and writing at the same time.  A typical example where you
  18. might have problems is when playing multimedia files like AVI and MPEG
  19. animations.  The write combining options of this program can be used
  20. without problems on any version of the 82450.
  21.  
  22. If you have a pre-B0 motherboard you may want to play around with write
  23. posting to see the difference it makes but you shouldn't enable it all the
  24. time -- it WILL occasionally lock up your computer.  If you really want or
  25. need write posting you should consider getting a new motherboard.
  26.  
  27. Be forewarned: YOU USE THIS PROGRAM AT YOUR OWN RISK.
  28.  
  29. --------------------------------------------------------------------------
  30.             End of Warning.
  31. --------------------------------------------------------------------------
  32.  
  33. This program enables Write Posting, banked VGA Write Combining and SVGA
  34. linear frame buffer Write Combining on Pentium Pro motherboards based on
  35. the 82450 and 82440 chipset.  This will significantly improve graphic
  36. performance from DOS and Win95.
  37.  
  38. The program must execute privileged instructions so it must be run in real
  39. mode.  For the time being that means it must be run from DOS.  You cannot
  40. run it from a DOS window or a full screen DOS session from Windows 3.x,
  41. Win95, WinNT or OS/2.  For DOS, Windows 3.x and Win95 you can include the
  42. program in your AUTOEXEC.BAT file (keep in mind that DOS4GW.EXE must be in
  43. your search path).  If you try to run the program from a protected mode OS
  44. you will get a DOS4GW error message and register dump.
  45.  
  46. --------------------------------------------------------------------------
  47.  
  48. Steppings of the 82450 chipset before B0 have bugs which forced Intel to
  49. disable Write Posting -- in essence cache writes have been disabled for
  50. the PCI bus.  The B0 stepping has been fixed and Write Posting is enabled
  51. by default by the BIOS.  The difference is easily visible in writing to
  52. video memory.  An A2 motherboard can only write about 8MB/sec to the
  53. graphics card, a B0 motherboard gets about 18MB/sec.  The 82440 chipset
  54. does not have this problem and virtually all 82440 BIOS's enable write
  55. posting by default.
  56.  
  57. But this is not the entire story.  With the Pentium Pro, Intel also
  58. decided that the enabling of Write Combining (the combining of several
  59. writes into a cache line that can be bursted out the PCI bus) should be
  60. the responsibility of the O/S, not the BIOS.  By enabling Write Combining
  61. the throughput to video RAM can be further increased to 88MB/sec or more.
  62.  
  63. There are two mechanisms for which Write Combining needs to be enabled:
  64. the banked VGA mechanism (the 128KB from A0000 to BFFFF) and the unbanked,
  65. linear frame buffer that all of the newer graphic cards support.  I will
  66. refer henceforth refer to linear frame buffer write combining as LFBWC and
  67. banked VGA write combining as BVWC.
  68.  
  69. Most low resolution DOS graphics applications and games use the banked
  70. mechanism.  Since the VESA committee has defined a standard, and UNIVBE
  71. and a few of the graphic card manufacturers have provided the VESA 2.0
  72. services, some of the latest games use the linear frame buffer (Duke
  73. Nuke'm 3D and Quake are for example).  The linear frame buffer usually
  74. gives better performance since it alleviates the reqirement to switch
  75. banks in hires modes.
  76.  
  77. I have only personally tested this program with 2MB and 4MB Matrox MGA
  78. Millennium cards.  It has been run by others with other cards (S3 964
  79. based, S3 968 based, Tseng 6000 based) and most benefit to some extent. 
  80. The Number Nine Imagine 128 card does not seem to benefit under most
  81. circumstance and turns in dismal DOS video scores.  Some users have
  82. reportet that starting Win95 after running VSPEED increases the LFB
  83. performance to the same range as most other hi performance cards.
  84.  
  85. With a 2MB Millennium there were problems with BVWC -- most hires VESA
  86. modes would result in vertical stripes over the entire screen.  This
  87. appears to be either a hardware or software bug on the part of Matrox.  I
  88. found a workaround which eliminates the stripes but reduces BVGA
  89. performance a bit.  The LFB will still run at full speed.  Using a
  90. negative value for the number of megabytes (for example "FASTVID  x11 -2")
  91. will enable this workaround.
  92.  
  93. I haven't tested FASTVID on any 8MB graphic cards but I think it will work
  94. properly.  Please let me know if you find othewise.
  95.  
  96. On many graphic cards, enabling the BVWC results in problems with some
  97. programs that use VGA mode 0x12 (640x480x16colors).  This appears to be
  98. either a hardware or software problem on the part of manufacturers.  The
  99. problem is only aparent with BVWC so you can run with that disabled if
  100. necessary.  For example use "FASTVID x01".  Note that this is not the same
  101. as the "vertical stripe" problem mentioned above.
  102.  
  103. Unfortunately, I have found that EMM386 (and other memory managers like
  104. QEMM and 386MAX) interferes in some way with LFBWC.  When running DOS you
  105. must remove EMM386 from your CONFIG.SYS file for LFBWC to work (BVWC is
  106. not affected).  If EMM386 is loaded you will see no increase in speed of
  107. the linear frame buffer.  In most cases, if you use a memory manager,
  108. running Win95 will re-enable the LFBWC.
  109.  
  110. LFB write combining requires that FASTVID know where the linear frame
  111. buffer is located.  Different graphic card manufacturers put it at
  112. different addresses.  The LFBWC code in FASTVID currently queries any
  113. installed VESA BIOS Extension driver for the LFB address so you should
  114. install your VESA driver before FASTVID.  If you don't have a VESA driver
  115. loaded (keep in mind that many cards have the driver in BIOS so you don't
  116. need to explicitly load one) or your VESA driver doesn't support the LFB,
  117. FASDVID will examine the PIC configuration registers for the LFB address. 
  118. This isn't always successful -- there are several registers and different
  119. cards use different ones.  If none of these methods works you will have to
  120. supply an LFB address.  Theoretically this program will work for any LFB
  121. address but I have only personally tested and verified that it works for
  122. the Matrox MGA Millennium at 0xFF000000.  Others have successfully used it
  123. with other graphics cards at other addresses.  If you supply an incorrect
  124. LFB address you will not see any increase in speed of the LFBWC.
  125.  
  126. If FASTVID can't automatically detect the LFB address, you can determine
  127. it's location from Win95.  Select Start, Settings, Control Panel, (or My
  128. Computer, Control Panel), System, Device Manager, Display Adaptors, your
  129. graphics card, Resources.  Scroll to the bottom of the Resource Settings
  130. box and you will see a line (or a few lines) that reads: "Memory Range
  131. XXXXXXXX - YYYYYYYY".  The first value is the location of the linear frame
  132. buffer.  For the Matrox MGA Millennium it is 0xFF000000.  If you have
  133. another address take note of it and input it into FASTVID when asked.  If
  134. there are several address try each of them.  Ignore the following memory
  135. regions: A0000-AFFFF, B0000-BFFFF, C0000-CFFFF.
  136.  
  137. --------------------------------------------------------------------------
  138.  
  139. Usage: FASTVID XYZ N ADDRESS
  140.  
  141.     X controls Write Posting.
  142.     Y controls VGA (banked) Write Combining.
  143.     Z controls SVGA (linear frame buffer) Write Combining.
  144.         For all three, 0 disables, 1 enables, any other value
  145.         results in no change from the current setting.
  146.     N indicates the amount of video memory in MegaBytes.
  147.         Valid values are 2, 4, and 8.  Also valid are -2, -4,
  148.         and -8 to apply the special "vertical stripe" patch.
  149.     ADDRESS is the address of the linear frame buffer in hex.
  150.         The Matrox MGA Millennium has it at FF000000.
  151.  
  152. Example 1: FASTVID
  153.  
  154.     If no arguments are supplied you run through a question and answer
  155.     dialogue and the program sets up the environment.  It will also
  156.     tell you what the equivalent command line is for the options you
  157.     chose.
  158.  
  159. Example 2: FASTVID 111 4
  160.  
  161.     Write posting is enabled (82450 only).
  162.     VGA Write Combining is enabled.
  163.     SVGA Write Combining is enabled, FASTVID will attemp to locate
  164.     the LFB on it's own.
  165.  
  166. Example 3: FASTVID x01 4 FF000000
  167.  
  168.     The write posting setting is not changed by FASTVID.
  169.     VGA Write Combining is disabled.
  170.     SVGA Write Combining is enabled for 4MB video memory at FF000000.
  171.  
  172. Example 4: FASTVID 111 -2 FF000000
  173.  
  174.     Write posting is enabled (82450 only).
  175.     VGA Write Combining is enabled.  "Vertical stripe" patch applied.
  176.     SVGA Write Combining is enabled for 2MB video memory at FF000000.
  177.  
  178. --------------------------------------------------------------------------
  179.  
  180. Included is a test program called VSPEED.EXE that reports the video
  181. throughput for bit blit operations from DRAM to VRAM for both the banked
  182. VGA and linear frame buffer mechanisms.
  183.  
  184. If you experience difficulties with VSPEED (the program locks up or
  185. crashes) try using -l or -L on the command line to eliminate the linear
  186. frame buffer test.  For example:
  187.  
  188.     VSPEED -l
  189.  
  190. will test only the banked VGA mechanism.
  191.  
  192.     VSPEED
  193.  
  194. will test both the banked VGA and the linear frame buffer (assuming the
  195. card and VESA driver support it).
  196.  
  197. --------------------------------------------------------------------------
  198.  
  199. Sample VSPEED results from an Intel Aurora motherboard with the B0
  200. stepping of the 82450 and a 4MB Matrox MGA Millennium:
  201.  
  202. FASTVID 000
  203. Copy DRAM to banked VGA:           8.07 million bytes per second
  204. Copy DRAM to linear framebuffer:   8.14 million bytes per second
  205.  
  206. FASTVID 100
  207. Copy DRAM to banked VGA:          18.72 million bytes per second
  208. Copy DRAM to linear framebuffer:  18.91 million bytes per second
  209.  
  210. FASTVID 011
  211. Copy DRAM to banked VGA:          37.95 million bytes per second
  212. Copy DRAM to linear framebuffer:  39.60 million bytes per second
  213.  
  214. FASTVID 111
  215. Copy DRAM to banked VGA:          87.72 million bytes per second
  216. Copy DRAM to linear framebuffer:  93.46 million bytes per second
  217.  
  218. FASTVID 111 -2
  219. Copy DRAM to banked VGA:          49.20 million bytes per second
  220. Copy DRAM to linear framebuffer:  93.46 million bytes per second
  221.  
  222. --------------------------------------------------------------------------
  223.  
  224. The following tests were run on an Intel Aurora motherboard with the B0
  225. stepping of the 82450, 64MB DRAM (all four SIMM sockets populated), and a
  226. 4MB Matrox MGA Millennium.  The "000" setting simulates an A2 motherboard
  227. where Write Posting is disabled.
  228.  
  229. --------------------------------------------------------------------------
  230. program:               fastvid setting: 000     100     011     111
  231. --------------------------------------------------------------------------
  232.  
  233. VSPEED (LFB, million bytes/sec)           8      19      40      93
  234. Duke Nuke'm 3D (640x480, fps)            14      25      18      31
  235. Doom Benchmark (fps)                     38      70      48      74
  236. 640x480 FLC animation (fps)              25      48      88     121
  237. Chris's 3D benchmark (SVGA)              21      38      66      77
  238.  
  239. Note that differences in motherboard and graphic card design may lead to
  240. different results.  Most notably, some cards cannot sustain 93MB/sec in
  241. the VSPEED test.  82440 base motherboards usually perform a bit better in
  242. real world applications because of better DRAM and PCI access times.
  243.  
  244. The above are all DOS applications.  If you have an A2 motherboard turning
  245. on write posting will increase the WinBench96 Graphic Winmark score by
  246. about 25 percent.  The write combining features don't make much difference
  247. to the Graphic Winmark score but there _are_ circumstance where write
  248. combining can make a big difference.  One example is using the Media
  249. Player to play an animation to a high resolution, highcolor or truecolor
  250. window.  For example:
  251.  
  252. Run Win95 in a high resolution, direct color mode; say 1024x768, 24bits
  253. per pixel.  Start the Media Player.  Open \FUNSTUFF\VIDEOS\WEEZER.AVI from
  254. the Win95 CD-ROM.  Enlarge the playback window to nearly full screen (do
  255. not use the Media Player's "full screen" option -- if you do it will
  256. change the screen to a lower resolution 8 bit mode for playback).  Press
  257. the Play button.  With write posting and write combining turned off you
  258. will get very poor results, about 2 frames per second.  With write posting
  259. on and write combining off that will improve to about 4 frames per second.
  260. With both write posting and write combining on you will get very smooth
  261. playback with the frame rate too fast to count.
  262.  
  263. You can see similar affects with the Hover! game on the Win95 CD-ROM. 
  264. Again, with Win95 in a hires direct color mode, enlarge the game window as
  265. large as it will let you (about 640x480).  With write posting and write
  266. combinging off you will get poor performance.  With write posting on the
  267. game will be playable.  With write posting and write combining the action
  268. will be very smooth.
  269.  
  270. If you have a pre-B0 motherboard you can still benefit from write
  271. combining (without fear of encountering the 82450 bugs) in the above DOS
  272. and Win95 situations.  Just don't enable write posting.
  273.  
  274. --------------------------------------------------------------------------
  275.             further descriptions:
  276. --------------------------------------------------------------------------
  277.  
  278. 1) Write Posting:
  279.  
  280. Write Posting is where the processor "posts" data to the PCI bus and then
  281. goes on it's way without waiting for the write operation to complete.
  282. Because of bugs in the pre-B0 stepping of the 82450 chipset Write Posting is
  283. disabled on early Pentium Pro motherboards.  This severly limits the PCI
  284. throughput to about 8MB/sec.  Most Pentium motherboards these days can get
  285. over 80MB/sec, 10 times faster.  FASTVID can enable Write Posting on these
  286. motherboards, increasing PCI throughput to about 18MB/sec.  You don't want to
  287. do this routinely because the bugs in the chipset will eventualy cause the
  288. PCI bus to hang, forcing a reboot of the machine.  Motherboards with the B0
  289. stepping have this bug fixed and Write Posting enabled by default.
  290.  
  291.  
  292. 2) Banked VGA Write Combining (BVGAWC):
  293.  
  294. This function allows seperate writes to the banked VGA mechanism to be
  295. combined into a cacheline that can be bursted out to video memory via the PCI
  296. bus.  I believe this used to be handled in hardware but Intel decided to make
  297. it a programable function with the Pentium Pro to make the motherboard
  298. architecture more general.  If you enable BVGAWC with FASTVID PCI throughput
  299. will increase from 18MB/sec (B0 motherboard) to 90MB/sec for programs that
  300. use the banked VGA mechanism (most DOS games).  If you enable only BVGAWC on
  301. an early motherboard (Write Posting remains off) the bus bandwidth increases
  302. from 8MB/sec to about 40MB/sec.  Some of the newer motherboards (ASUS for
  303. instance) have this as a BIOS setup option.
  304.  
  305.  
  306. 3) Linear Frame Buffer Write Combining:
  307.  
  308. Many newer graphics cards have their graphics memory mapped linearly at very
  309. high physical addresses (in addition to the banked VGA mechanism at A000:0000
  310. and B000:0000) beyond the 2GB mark.  The reason for doing this is to make
  311. access to video memory simpler and faster -- programs (and Windows drivers)
  312. don't have to switch banks all the time to access all of video memory.  I
  313. believe Pentium motherboards enable Write Combining for all high addresses
  314. but the Pentium Pro design requires the use of the processors MSR registers
  315. to enable Write Combining.  Again, this was done to generalize the
  316. motherboard design.  You can theoretically have multiple devices mapped in
  317. high address space with different cachability options.  Intel believes that
  318. proper place for this to be handled is within a PNP operating system.
  319. Unfortunately, no operating system yet supports this.  As with BVGAWC, LFBWC
  320. will increase PCI throughput from 18MB/sec to 90MB/sec (or 8MB/sec to
  321. 45MB/sec with Write Posting off) for programs that use the linear frame
  322. buffer (some of the new hires DOS games, Windows drivers).
  323.  
  324.  
  325. Exactly how much a difference any of these functions makes depends on the
  326. applications being run and the graphics card you're using.  If you are using
  327. a very slow graphics card you won't see much difference.  Programs that do
  328. very little graphic output will show little or no difference.  Programs that
  329. do lots of graphic output (realtime 3D games, multimedia animations) can show
  330. a large difference.  There are even circumstances under Win95, OS/2 and NT
  331. where the difference can be huge.
  332.  
  333. Here are some results with my Matrox MGA Millennium:
  334.  
  335.                                       A2      B0     FASTVID
  336. ----------------------------------------------------------------
  337.  Duke Nuke'm 3D (640x480, fps)        14      25       31
  338.  Doom Benchmark (fps)                 38      70       74
  339.  640x480 FLC animation (fps)          25      48      121
  340.  Chris's 3D benchmark (SVGA)          21      38       77
  341.  Win95 Media Player* (fps)             2       5       15**
  342.  
  343. * WEEZER.AVI from the Win95 CD-ROM enlarged to _nearly_ full screen at
  344. 1152x864, 32 bits-per-pixel.
  345.  
  346. ** the frame rate was too fast to count, 15fps is an estimate -- the
  347. animation played fairly smoothly.
  348.  
  349. --------------------------------------------------------------------------
  350.  
  351. Notes for 82440 (Natoma chipset) based motherboards:
  352.  
  353. Several FASTVID users have reported that one BIOS setting on these
  354. motherboards conflicts with FASTVID resulting in a system crash.  If you
  355. experience these crashes try turning off "USWC write posting" (Uncached
  356. Speculative Write Combining) using the BIOS setup procedure.
  357.  
  358. FASTVID's controls for write-posting don't seem to have any effect on
  359. 82440 motherboards.  Presumably this means that write-posting is
  360. controlled by a different mechanism.  I suggest using "FASTVID x11" so
  361. that FASTVID doesn't attempt to change the write-posting option if you
  362. have one of these motherboards.
  363.  
  364. --------------------------------------------------------------------------
  365.  
  366.